package autonomous;

import java.util.ArrayList;

public class Flock {
	ArrayList<FlockBoid> boids; // An arraylist for all the boids
	int finish; // what was my finish? (first, second, etc. . . )

	public Flock() {
		boids = new ArrayList<FlockBoid>(); // Initialize the arraylist

	}

	public void run() {
		for (int i = 0; i < boids.size(); i++) {
			FlockBoid b = (FlockBoid) boids.get(i);
			b.run(boids); // Passing the entire list of boids to each boid
							// individually
		}
	}

	public void addBoid(FlockBoid b) {
		boids.add(b);
	}

	public FlockBoid getBoid(int b) {
		return (FlockBoid) boids.get(b);
	}

	public void removeBoid(int b) {
		boids.remove(b);
	}

	public int size() {
		return boids.size();
	}

	boolean finished() {
		// float d = dist(loc.x, loc.y, target.r.x, target.r.y);
		// if (d < recordDist)
		// recordDist = d;
		// // if ( d < diam/2) {
		// if (target.contains(loc)) {
		// stopped = true;
		// return true;
		// }
		return false;
	}

	void setFinish(int f) {
		finish = f;
		// print(finish + " ");
	}

}
